<style lang="scss" scoped>
.log-container {
  padding: 20px;
}
</style>

<template>
  <el-drawer
    title="日志"
    :visible="showDialog"
    size="400px"
    :wrapper-closable="true"
    @close="$emit('update:visible', false)"
  >
    <div class="log-container">
      <el-table :data="data" height="calc(100vh - 100px)" border>
        <el-table-column label="内容" prop="log_info" min-width="200px" />
        <el-table-column label="时间" prop="add_time" min-width="150px" />
      </el-table>
    </div>
  </el-drawer>
</template>

<script>
export default {
  props: {
    visible: {
      type: Boolean,
      required: true
    },

    data: {
      type: Array,
      default: () => []
    }
  },

  data() {
    return {
      showDialog: false
    }
  },

  watch: {
    visible() {
      this.showDialog = this.visible
    }
  }
}
</script>

<style></style>
